﻿using OnWork.DataCenter.DAL.Common;
using SqlSugar;

namespace OnWork.DataCenter.DAL.DataCenter
{
    /// <summary>
    /// 数据源 MQTT执行日志表
    /// </summary>
    [SplitTable(SplitType.Day)]//按日分表 （自带分表支持 年、季、月、周、日）
    [SugarTable("DSMqttLog_{year}{month}{day}")]//3个变量必须要有，这么设计为了兼容开始按年，后面改成按月、按日
    public class DSMqttLog : BaseEntity
    {
        /// <summary>
        /// 执行类型 断开,连接
        /// </summary>
        public string Type { get; set; }

        /// <summary>
        ///结果返回的内容
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDataType = StaticConfig.CodeFirst_BigString)]
        public string Content { get; set; }

        /// <summary>
        /// 订阅的主题
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string Topic { get; set; }

        /// <summary>
        /// 服务Ip代理端口号
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public int BrokerPort { get; set; }

        /// <summary>
        /// 客户端ID
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string ClientID { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string UserName { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string? Password { get; set; }

        /// <summary>
        /// MQTT服务配置的ID
        /// </summary>
        public long MqttID { get; set; }
    }
}